function to (promiseObj) {
  const newP = promiseObj.then(res => {
    return [null, res]
  }).catch(err => {
    return [err, null]
  })
  return newP
}

export default to
